<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function fn(a,b){
            console.log(this,a,b);
        }

        // let obj = {
        //     f:fn
        // }
        // obj.f();
        let obj = {name:'atguigu',age:10}

        // fn.call(obj,1,2);   // call 可以改变this指向，并且函数立即执行
        // fn.apply(obj,[1,2]);// 
        let newFn = fn.bind(obj,1,2);      // bind不会立即执行，会返回一个函数。并且this指向已经被改变过的
        newFn();

        

    </script>
</body>
</html>